package Negocio;

import java.util.ArrayList;
import java.util.List;

import DTO.DTO_Salon;
import DTO.DTO_Sector;
import Entities.Entity_Salon;
import Entities.Entity_Sector;

public class Salon {
	
	private List<Sector> sectores;

	public Salon(List<Sector> sectores) {
		super();
		this.sectores = sectores;
	}
	
	public Salon(DTO_Salon salon){
		this.sectores = new ArrayList<Sector>();
		for(DTO_Sector s : salon.getSectores()){
			this.sectores.add(new Sector(s));
		}
		
	}

	public Salon() {
	}
	
	public Salon(Entity_Salon salon) {
		this.sectores = new ArrayList<Sector>();
		for(Entity_Sector s : salon.getSectores()){
			this.sectores.add(new Sector(s));
		}
	}

	public List<Sector> getSectores() {
		return sectores;
	}

	public void setSectores(List<Sector> sectores) {
		this.sectores = sectores;
	}
	public DTO_Salon toDTO()
	{
		DTO_Salon salon = new DTO_Salon();
		List<DTO_Sector> sects = new ArrayList<DTO_Sector>();
		for(Sector sect: sectores)
			sects.add(sect.toDTO());
		salon.setSectores(sects);
		return salon;
	}

	public Entity_Salon toEntity() {
		Entity_Salon salon = new Entity_Salon();
		List<Entity_Sector> sects = new ArrayList<Entity_Sector>();
		for(Sector sect: sectores)
			sects.add(sect.toEntity());
		salon.setSectores(sects);
		return salon;
	}
	

}
